package com.itlong.cloud.controller;

import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AppDemoController {

    private static Logger LOG = LoggerFactory.getLogger(AppDemoController.class);

    /*@Value("${" + PlatformConstants.APP_USER_TOKEN_KEY + "}")
    public String APP_USER_TOKEN_KEY;

    @Value("${" + PlatformConstants.FILE_FTP_USERNAME + "}")
    public String FILE_FTP_USERNAME;

    @Value("${" + PlatformConstants.FILE_FTP_HOST + "}")
    public String FILE_FTP_HOST;

    @Value("${" + PlatformConstants.FILE_FTP_PASSWORD + "}")
    public String FILE_FTP_PASSWORD;

    @Value("${" + PlatformConstants.FILE_FTP_PORT + "}")
    public String FILE_FTP_PORT;

    @Value("${" + PlatformConstants.FILE_ACCESS_URL + "}")
    public String FILE_ACCESS_URL;*/


    /*public static void main(String[] args) {

        try {
            File file = new File("d:/test.txt");
            FileInputStream inputStream = new FileInputStream(file);
            //获取文件后缀
            String fileSuffix = UploadFileUtil.getFileSuffix(file.getName());
            try {

                UploadFileUtil.UploadFile uploadFileUtil = new UploadFileUtil().new UploadFile(
                        PlatformConstants.FILE_FTP_HOST,
                        PlatformConstants.FILE_FTP_USERNAME,
                        PlatformConstants.FILE_FTP_PASSWORD,
                        PlatformConstants.FILE_FTP_PORT,
                        inputStream,
                        fileSuffix,
                        PlatformConstants.FILE_ACCESS_URL,
                        "test/"
                );
                Map<String, Object> resultMap = UploadFileUtil.uploadFile(uploadFileUtil);
                System.out.println(resultMap.get("returnCode") + ":" + resultMap.get("accessPath").toString());
            } catch (Exception ex) {
                throw new DataAccessException("【文件上传失败】",ex);
            }
        } catch (FileNotFoundException ex) {
            throw new DataAccessException("【文件上传失败】",ex);
        }
    }*/

}
